package com.carmeth.geo;

import java.util.ArrayList;

import com.carmeth.geo.bean.Casa;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class CasasListAdapter extends BaseAdapter{
	
	private Context ctx;
	private ArrayList<Casa> casas;
	
	public CasasListAdapter(ArrayList<Casa> casas, Context ctx) {
		this.ctx=ctx;
		this.casas=casas;
	}
	
	@Override
	public int getCount() {
		return casas.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {
		CasaView av = null;
		if(arg1 == null){
		av = new CasaView(ctx, casas.get(arg0));
		}else{
			av =  (CasaView)arg1;
		}
		av.update(casas.get(arg0));
		return av;
	}

}
